
//function sub(){
//	landing.addEventListener("click",function(e)){
//		console.log(e)
//	}
////	if(username.value == ""){
////		username.innerText = "用户名不能为空"
////	}
//}
//sub()
var username = document.getElementById("username");
var password1 = document.getElementById("password");
var passcode = document.getElementById("passcode");
var radio1 = document.querySelectorAll("input[name='dealine']");
console.log(radio1)
var hint1 = document.querySelector("#hint1");
var hint2 = document.querySelector("#hint2");
var hint3 = document.querySelector("#hint3");
var landing = document.getElementById("landing");
var arr = [];
function sub(){
	landing.addEventListener("click",function(e){
		e.preventDefault()
		if(username.value == ""){
				hint1.innerText = "用户名不能为空"
			}else{
				hint1.innerText = null;
				
			}
		if(password1.value == ""){
				hint2.innerText = "密码不能为空"
			}
		else{
				hint2.innerText = null;
			}
		if(passcode.value == ""){
				hint3.innerText = "用户名不能为空"
			}
		else{
				hint2.innerText = null;
			}
		var obj = {}

		for(var i=0;i<radio1.length;i++){
			console.log(radio1[i].checked)
			console.log(radio1[i])
			if(radio1[i].checked){
				console.log(radio1[i].value)
				obj.radio = radio1[i].value;
//				obj.radio = radio1[i].value;
			}
		}
		if(username!="" && password1!=""){
			obj.username = username.value;
			obj.password = password1.value;
		}
		console.log(obj)
		alert("用户名："+obj.username+" 密码："+obj.password+" 期限："+obj.radio)
			})
}
sub()